  <%   
  /** 
  * Description : defect list detail view with defectID
  *** supposed to recever defectID from previous page***
  * update : none
  * Date : 2/28/2014, update date :
  * Written by : Team B(Kapsoo kim(nagoorum@naver.com) )
  */ 
  %>
  
 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <%@ page import="com.DefectTracking.*" %>
 
 
 <!------------------------------------------------->
 <!-------------------head ----------------------->
 <!------------------------------------------------->
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>Defect Tracking System</title>
 <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.4.2/pure-min.css">
 </head>
 <body>
             
 <center>
 <br>
 <div class="pure-g">
 	<style scoped>
         .button-secondary {
             color: white;
             border-radius: 4px;
             text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
         }
         .button-secondary {
             background: rgb(66, 184, 221); /* this is a light blue */
         }
 
 	</style>
 	
     <div class="pure-u-1-3"> </div>
     <div class="pure-u-1-3">
     	<button class="button-secondary pure-button">Defect Tracking System</button> 
     </div>
     <div class="pure-u-1-3"> Team B </div>
 </div>
 <br><br>
 <!------------------------------------------------->
 <!-------------------head ----------------------->
 <!------------------------------------------------->
 
 <u><h3>Detail of the defect</h3></u>
 
 <!------------------------------------------------->
 <!-------------------detail of defect ----------------------->
 <!------------------------------------------------->
 
 
 <%
 		//retrieve "defectid" value from list.jsp file
 		int defect_id = Integer.parseInt(request.getParameter("defectid"));
 	
 		//Declear DefectDetail 
 		DefectDetailManager mgr = new DefectDetailManager();
 		DefectDetail dd = mgr.getDefectDetail(defect_id);	
 		   	
    		//Assignee Name(fist,last) Null check( if null -> "")
    		String assignee_fname = "";
    		String assignee_lname = "";
    		if ( dd.getAssigneeFname() == null) {
    		 	 assignee_fname = "";
    		}else{
    		 	assignee_fname = dd.getAssigneeFname();
    		} 
    		if ( dd.getAssigneeLname() == null) {
 		 	 assignee_lname = "";
 		}else{
 		 	assignee_lname = dd.getAssigneeLname();
 		}
    	
 		//close_data Null check(if null -> "")
    	    String cl_date = "";
    	   	if ( dd.getClosedDate() == null) {
    	   	 	cl_date = "";
    	   	}else{
    	   	 	cl_date = dd.getClosedDate().toString();
    	   	}  
 %>			
 
 			<table class="pure-table" width="700">
 			    <thead>
 			    	<tr class="pure-table-odd" >
 			    		<th align="center">Summary</th>
 			        	<th align="center" width="80%"><%=dd.getSummary()%> </th>
 			   		</tr>
 			    </thead>
 			    
 			    <tbody>
 			    <tr>
 			        <td height="150" align="center">Description</td>
 			        <td height="150" align="left" >
 			        	<pre><%=dd.getDetails()%></pre>
 			        </td>
 			    </tr>
 			   
 			    <tr class="pure-table-odd">
     				<td align="center">Register date</td>
         			<td align="center"><%=dd.getDetectedOn() %></td>
     			</tr> 
 				<tr >
     				<td align="center">Register</td>
        				<td align="center"><%=dd.getDetectedByFname()%> <%=dd.getDetectedByLname() %></td>
     			</tr>    
 				<tr class="pure-table-odd">
     				<td align="center">Status</td>
         			<td align="center"><%=dd.getDefectstatusName() %></td>
     			</tr>     
     			<tr > 
 					<td align="center">Assignee</td>
         			<td align="center"><%=assignee_fname%> <%=assignee_lname%></td>        
     			</tr>  
     			<tr class="pure-table-odd">
     				<td align="center">Closed data</td>
         			<td align="center"><%=cl_date %></td>
 				</tr>
     		</tbody>
 		  </table>
 				
 			
 
 
 <!------------------------------------------------->
 <!------------------- link to list/edit/submit pages----------------------->
 <!------------------------------------------------->
 </br></br></br>
 <a class="pure-button pure-button-primary" href="./list.jsp">All list</a>&nbsp;&nbsp;
 <a class="pure-button pure-button-primary" href="./edit.jsp?defectid=<%=defect_id %>">Update</a>&nbsp;&nbsp;
 <a class="pure-button pure-button-primary" href="./submit_defect.jsp">Submit New Defect</a>
 
 	
 	</br>
 	</br>
 	</br>
 
 </center>
 </body>
</html>